namespace OracleInternal.BinXml
{
	internal class DTDObject : ObxmlStateObject
	{
		internal DTDObjectTypes DTDObjectType;

		private string m_objectValue;

		internal string ObjectName;

		internal string PublicId;

		internal string SystemId;

		internal string Note;

		internal string ObjectValue
		{
			get
			{
				return m_objectValue;
			}
			set
			{
				if (value != null)
				{
					if (1 == (ObxmlDecodeContext.m_XMLTypeOptimizationLevel & 1))
					{
						m_objectValue = value;
					}
					else
					{
						m_objectValue = value.ReplaceXmlChars();
					}
				}
				else
				{
					m_objectValue = null;
				}
			}
		}

		internal bool IsEntity
		{
			get
			{
				if (DTDObjectType != DTDObjectTypes.Entity)
				{
					return DTDObjectType == DTDObjectTypes.PartialEntity;
				}
				return true;
			}
		}

		internal bool IsParsedEntity
		{
			get
			{
				if (IsEntity)
				{
					return !string.IsNullOrEmpty(ObjectValue);
				}
				return false;
			}
		}

		internal bool IsUnparsedEntity
		{
			get
			{
				if (IsEntity)
				{
					if (!IsParsedEntity)
					{
						return !string.IsNullOrEmpty(Note);
					}
					return false;
				}
				return false;
			}
		}

		internal bool IsExternalEntity
		{
			get
			{
				if (IsEntity)
				{
					if (!IsParsedEntity && !IsUnparsedEntity)
					{
						return !string.IsNullOrEmpty(Note);
					}
					return false;
				}
				return false;
			}
		}

		internal DTDObject()
		{
			ClearStateObject();
		}

		internal DTDObject(DTDObjectTypes objectType)
		{
			DTDObjectType = objectType;
		}

		internal DTDObject(DTDObjectTypes objectType, string objectName)
		{
			DTDObjectType = objectType;
			ObjectName = objectName;
		}

		internal override void ClearStateObject()
		{
			DTDObjectType = DTDObjectTypes.DTD;
		}
	}
}
